Skip to content

Instantly share code, notes, and snippets.

@panzi
panzi / pil2cv.py
Created July 5, 2021 16:00
Python: Convert PIL.Image to OpenCV BGR(A)/grayscale image (NumPy array). This supports the most common image modes, but there are more! Patches for those are welcome.
from PIL import Image
import numpy as np
import cv2
def pil2cv(image: Image) -> np.ndarray:
mode = image.mode
new_image: np.ndarray
if mode == '1':
new_image = np.array(image, dtype=np.uint8)
@edokeh
edokeh / index.js
Last active May 10, 2024 15:55
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@Zekfad
Zekfad / conventional-commits.md
Last active May 10, 2024 15:55
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@amazingmarvin
amazingmarvin / marvin-toggl-tracking.sh
Created June 17, 2021 10:02 — forked from selfire1/marvin-toggl-tracking.sh
A shell script to start tracking an Amazing Marvin task in Toggl Track.
#!/bin/bash
# -------------------------------------------------
# Before running the script, make sure that you understand it. Running code you find on the Internet may damage your system.
# -------------------------------------------------
# In Amazing marvin, set the path to this script as "Start time tracking task" in the "System Triggers strategy" like this:
# /Path/to/this/script $TASK_TITLE
# Replace "YourSecretToken" with your Toggl API token below.
# -------------------------------------------------
curl -v -u YourSecretToken:api_token \
@lukebeer
lukebeer / GoogleHackMasterList.txt
Last active May 10, 2024 15:53 — forked from cmartinbaughman/GoogleHackMasterList.txt
The definitive super list for "Google Hacking".
admin account info" filetype:log
!Host=*.* intext:enc_UserPassword=* ext:pcf
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd
"AutoCreate=TRUE password=*"
"http://*:*@www” domainname
"index of/" "ws_ftp.ini" "parent directory"
"liveice configuration file" ext:cfg -site:sourceforge.net
"parent directory" +proftpdpasswd
Duclassified" -site:duware.com "DUware All Rights reserved"
duclassmate" -site:duware.com
Problem 1
- laravel/installer v1.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- laravel/installer v1.4.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
- Installation request for laravel/installer ^1.4 -> satisfiable by laravel/installer[v1.4.0, v1.4.1].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
@yejun
yejun / how_to_bluetooth.md
Last active May 10, 2024 15:52
Use pulseaudio as bluetooth speaker on archlinux

Install packages

  • bluez
  • bluez-utils
  • pulseaudio-bluetooth

Enable bluetooth

Edit /etc/bluetooth/main.conf, uncomment following lines

@cassidoo
cassidoo / mergerefs.jsx
Created January 10, 2023 22:57
Merge refs in React so a component can have more than one ref
export function mergeRefs(refs) {
return (value) => {
refs.forEach((ref) => {
if (typeof ref === "function") {
ref(value);
} else if (ref != null) {
ref.current = value;
}
});
};
@senthilmurukang
senthilmurukang / stash-copy.sh
Last active May 10, 2024 15:50
shell script to copy stash from one folder to another. Example usage: ./stash-copy.sh /path/to/git/old/folder /path/to/git/new/folder
src=$1
dest=$2
current_directory=$(pwd)
cd $src
stashes=$(git stash list)
IFS=$'\n'
stash_messages=()
for stash in $stashes; do
@sataniceypz
sataniceypz / alive.js
Last active May 10, 2024 15:49 — forked from Kingbadan321/alive.js
Custom Alive For Izumi-xd
const { command, isPrivate, getBuffer } = require("../lib/");
const config = require("../config");
// Edit here 👇🏿🌸
let title = "𝗜𝗭𝗨𝗠𝗜-𝗫𝗗"
let body = "𝗛𝗲𝘆 𝗜𝘇𝘂𝗺𝗶 𝗶𝘀 𝗔𝗹𝗶𝘃𝗲🧚‍♂️"
let sourceUrl = "github.com/sataniceypz/Izumi-v2"
let mediaUrl = "github.com/sataniceypz/Izumi-v2"
let mediaType = 1